package com.xh.bussiness.tiku.service;



import com.xh.bussiness.tiku.bean.dto.BookChapterDto;
import com.xh.bussiness.tiku.bean.request.BookChapterRequest;
import com.xh.bussiness.tiku.model.BookChapter;
import com.xh.core.service.IBaseService;
import com.xh.core.bean.XhPage;

import java.util.List;

/**
 * <p>
 * 教材章节 服务类
 * </p>
 *
 * @author daiwei
 * @since 2019-01-14
 */
public interface IBookChapterService extends IBaseService<BookChapter> {

    /**
     * 分页查询方法
     * @param page
     * @param bean
     * @return
     */
    public XhPage queryBookChapterPage(XhPage page, BookChapterRequest bean);

    /**
     * 查询方法
     * @param bean
     * @return
     */
    public List queryBookChapter(BookChapterRequest bean);

    List<BookChapter> queryBookChapterKnowledgeTree(String bookId);

    public List queryTree(String bookId);

	public void truncateTable();

    void initParentPath();

    /**
     * 初始化章节与知识点关系数据
     * @param bookChapters
     */
    void initBookChapterKnowledgeRelation(List<BookChapter> bookChapters);

    boolean addBookChapter(BookChapterDto bookChapterDto);

    boolean moveUpOrDownBookChapter(String bookChapterId, Integer moveType);

    void deleteCacheBySubjectCode(String subjectCode);

    BookChapterDto saveOrUpate(BookChapterDto bookChapterDto);
}
